Rust implementation of CRC(16, 32, 64)
use crc::{crc16, Hasher16};
assert_eq!(crc16::checksum_x25(b"123456789"), 0x906e);
assert_eq!(crc16::checksum_usb(b"123456789"), 0xb4c8);
let mut digest = crc16::Digest::new(crc16::X25);
digest.write(b"123456789");
assert_eq!(digest.sum16(), 0x906e);
let mut digest = crc16::Digest::new_with_initial(crc16::X25, 0u16);
digest.write(b"123456789");
assert_eq!(digest.sum16(), 0x906e);
use crc::{crc32, Hasher32};
assert_eq!(crc32::checksum_ieee(b"123456789"), 0xcbf43926);
assert_eq!(crc32::checksum_castagnoli(b"123456789"), 0xe3069283);
assert_eq!(crc32::checksum_koopman(b"123456789"), 0x2d3dd0ae);
let mut digest = crc32::Digest::new(crc32::IEEE);
digest.write(b"123456789");
assert_eq!(digest.sum32(), 0xcbf43926);
let mut digest = crc32::Digest::new_with_initial(crc32::IEEE, 0u32);
digest.write(b"123456789");
assert_eq!(digest.sum32(), 0xcbf43926);
use crc::{crc64, Hasher64};
assert_eq!(crc64::checksum_ecma(b"123456789"), 0x995dc9bbdf1939fa);
assert_eq!(crc64::checksum_iso(b"123456789"), 0xb90956c775a41001);
let mut digest = crc64::Digest::new(crc64::ECMA);
digest.write(b"123456789");
assert_eq!(digest.sum64(), 0x995dc9bbdf1939fa);
let mut digest = crc64::Digest::new_with_initial(crc64::ECMA, 0u64);
digest.write(b"123456789");
assert_eq!(digest.sum64(), 0x995dc9bbdf1939fa);